import request from '../utils/request.js'

/**
 * 人脸识别相关API
 */

// 人脸注册
export const faceRegister = (data) => {
  return request.post('/user/face/register', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 人脸登录
export const faceLogin = (data) => {
  return request.post('/user/face/login', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 统一人脸识别（自动判断登录或注册）
export const faceRecognition = (data) => {
  return request.post('/user/face/recognition', data, {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 根据人脸ID查询用户
export const getUserByFaceId = (faceId) => {
  return request.get(`/user/face/${faceId}`)
}

// 根据姓名查询用户
export const getUserByName = (name) => {
  return request.get(`/user/name/${name}`)
}

// 获取用户列表
export const getUserList = (params = {}) => {
  return request.get('/user/list', { params })
}

// 删除用户
export const deleteUser = (id) => {
  return request.delete(`/user/${id}`)
}
